function n = numel(lst, inds, varargin)
%NUMEL Gets the number of elements in the list 
%
% [ Syntax ]
%   - n = numel(lst)
%   - n = numel(lst, inds)
%
% [ History ]
%   - Created by Dahua Lin, on Jan 5, 2008
%


if nargin == 1
    n = lst.n;
    
elseif nargin == 2
    if ischar(inds) && inds == ':'
        n = lst.n;
    else
        n = numel(lst.items, inds);
    end
    
else
    error('sltoolbox:sllist:invalidsubs', ...
            'Only one-dimensional subscript-accessing is supported for sllist.');
end